from base.base import Base
from time import sleep
from selenium.webdriver.common.by import By

class SouSuoPage(Base):
    sousuokuang = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.FrameLayout[2]/android.widget.RelativeLayout/android.widget.ViewSwitcher')

    sousuoshuru  = (By.ID,'com.achievo.vipshop:id/search_text_view')

    sousuo = 'new UiSelector().text("搜索")'

    dy1 = 'new UiSelector().text("销量")'

    dy2  = 'new UiSelector().text("试试：")'
    dy3 = 'new UiSelector().text("洁面卸妆油")'

    def sousuoyewu(self,casename):
        self.loc_ele(self.sousuokuang).click()
        sleep(5)
        self.loc_ele(self.sousuoshuru).send_keys(casename)
        sleep(5)
        self.loc_ui_ele(self.sousuo).click()
        sleep(5)